package com.sz.framework.utils;

import android.support.annotation.StringRes;
import android.widget.Toast;

import com.sz.framework.base.BaseApplication;
public class ToastUtil {
    private static Toast mToast;
    public static void showToast(String msg){
        if(mToast == null){
            mToast = Toast.makeText(BaseApplication.getApp(),msg,Toast.LENGTH_SHORT);
        }else{
            mToast.setText(msg);
        }
        mToast.show();
    }

    public static void showToast(@StringRes int resId){
        if(mToast == null){
            mToast = Toast.makeText(BaseApplication.getApp(),resId,Toast.LENGTH_SHORT);
        }else{
            mToast.setText(resId);
        }
        mToast.show();
    }
}
